SET(TARGET_NAME "wx")
SET(TARGET_DIR "bin/${FLAVOR}/modules")

INCLUDE_DIRECTORIES (../include)
INCLUDE_DIRECTORIES (../../sgtCore/include)

INCLUDE_DIRECTORIES(${WX_INC_DIR})
LINK_DIRECTORIES (${WX_LIB_DIR})

INCLUDE_DIRECTORIES(${BOOST_INC_DIR})
LINK_DIRECTORIES (${BOOST_LIB_DIR})

ADD_DEFINITIONS(-DPLUG_LIBRARY)
ADD_DEFINITIONS(-DLUNA_BINDINGS)
# ADD_DEFINITIONS(-DCXX_ENABLED)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
ADD_DEFINITIONS(${WX_FLAGS})

FILE(GLOB_RECURSE PUBLIC_HEADERS "../include/*.h")

FILE(GLOB_RECURSE SOURCE_FILES "*.cpp" )

ADD_MSVC_PRECOMPILED_HEADER("plug_common.h" "plug_common.cpp" SOURCE_FILES)

# ADD_LUNA_FILES(SOURCE_FILES) # Add the Luna files after adding precompiled header.

ADD_LIBRARY (${TARGET_NAME} SHARED ${PUBLIC_HEADERS} ${SOURCE_FILES})

TARGET_LINK_LIBRARIES(${TARGET_NAME} sgtCore ${LUA_LIBS} ${WX_LIBS} ${BOOST_LIBS})  

INSTALL(TARGETS ${TARGET_NAME}
	RUNTIME DESTINATION ${TARGET_DIR}
	LIBRARY DESTINATION ${TARGET_DIR})

# step needed for the generation of the XML documentation:
SET(INTF_FILES)
LIST(APPEND INTF_FILES "${CMAKE_CURRENT_SOURCE_DIR}/../interface/wx")
ADD_FILES(INTF_FILES "../interface/helpers.h")
ADD_FILES(INTF_FILES "../include/wx_extensions.h")

SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES 
	PREFIX ""
	SUFFIX ".sgp")

SET(DOXY_PREDEFINED "__WXMSW__ WXDLLIMPEXP_RICHTEXT=  WXDLLIMPEXP_CORE= ")
# GENERATE_REFLECTION(${TARGET_NAME} INTF_FILES)
